<?php
$tpl = new SimpleTemplate(VIEW."gestaoSistema/sucessEmpresa.html");
$busca = new gestaoSistema;
$func = new functions;

$res = $busca->select_unique("SELECT * FROM inf_empresa WHERE id=1");


    if(!empty($res["id"])){
        $tpl->CNPJ = $func->get_value($res["cnpj"])->format("cnpj")->get();
        $tpl->RAZAO = $res["razao_social"];
        $tpl->NOME_FANTASIA = $res["nome_fantasia"];
        $tpl->INSCRICAO_ESTADUAL = $res["inscricao_estadual"];
        $tpl->RUA = $res["rua"];
        $tpl->COMPLEMENTO = $res["complemento"];
        $tpl->NUMERO = $res["numero"];
        $tpl->BAIRRO = $res["bairro"];
        $tpl->CEP = $func->get_value($res["cep"])->format("cep")->get();
        $tpl->CIDADE = $res["cidade"];
        $tpl->UF = $res["uf"];
        $tpl->TELEFONE = $func->get_value($res["telefone"])->format("phone")->get();
        $tpl->EMAIL = $res["email"];
        $tpl->SITE = $res["site"];
        
        $tpl->block("BLOCK_ALTERAR");       
    }
    else{
        $tpl->block("BLOCK_INCLUIR");
    }

        
        
$action = $func->get_isset("action")->get();

if($action == "alt")
   $tpl->block ("BLOCK_ALTERAR_SUCESSO");
else if($action == "inc")
   $tpl->block ("BLOCK_INCLUIR_SUCESSO");
    
$tpl->show();
?>
